package org.duoyi.striver.service.thread;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.duoyi.striver.model.impl.Sleeper;
import org.duoyi.striver.service.common.CommonService;

@Slf4j
public class Detection extends Thread {

    private final MainRunner mainRunner;

    public Detection(MainRunner mainRunner) {
        super("检测线程");
        this.mainRunner = mainRunner;
    }

    @Override
    @SneakyThrows
    public void run() {
        log.debug("{}启动", this.getName());
        CommonService.bindWindows();
        while (mainRunner.isState()) {
            Sleeper.sleep();
//            CommonService.isTeamInviting();
            Sleeper.sleep();
            CommonService.isGiftBox();
            Sleeper.sleep();
        }
        CommonService.release();
        log.debug("{}结束", this.getName());
    }
}
